package com.ysd.util;

import com.google.gson.Gson;

/**
 * 处理结果
 * 
 * @author Administrator
 *
 */
public class Result {//Result结果
	public boolean success;//是否成功
	public String message;//信息
	public String remark;//备注

	public static String toClient(boolean suc, Object msg) {
		Result r = new Result();
		r.success = suc;
		r.message = msg.toString();
		r.remark = "";
		Gson t = new Gson();
		return t.toJson(r);

	}
	//加了static的方法可以直接通过类名方法名来进行调用
	//result.toClient(true,"成功"，"备注信息")
	public static String toClient(boolean suc, Object msg, String remark) {
		Result r = new Result();
		r.success = suc;
		r.message = msg.toString();
		r.remark = remark;
		Gson t = new Gson();
		return t.toJson(r);
	}
}